﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Valentia.Kinection.Watchdog
{
    /// <summary>
    /// Class used to keep alive Kinect WatchDog
    /// </summary>
    public partial class frmKinectWatchDog : Form
    {
        #region Declarations

        /// <summary>
        /// Kinect device watchdog
        /// </summary>
        KinectWatchDog watchDog;

        #endregion

        #region Constructor

        /// <summary>
        /// Constructor
        /// </summary>
        public frmKinectWatchDog()
        {
            InitializeComponent();

            this.watchDog = new KinectWatchDog();
            this.watchDog.Start();
            this.Visible = false;
        }

        #endregion

        #region Form control events

        /// <summary>
        /// Occurs before the form is closed
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">Form closing event args</param>
        private void frmKinectWatchDog_FormClosing(object sender, FormClosingEventArgs e)
        {
            { try { this.watchDog.Dispose(); } catch { } }
        }

        #endregion

        private void frmKinectWatchDog_Load(object sender, EventArgs e)
        {

        }
    }
}
